package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 定活自转签约 确定信息
 */
public class SureLiveOnRotationPp extends BasePopupView {
    @BindView(R.id.sure_switchinfo_type)
    TextView sureSwitchinfoType;
    @BindView(R.id.sure_switchinfo_numtext)
    TextView sureSwitchinfoNumtext;
    @BindView(R.id.sure_username)
    TextView sureUsername;
    @BindView(R.id.sure_savemoney)
    TextView sureSaveMoney;
    @BindView(R.id.up_num)
    TextView upNum;
    @BindView(R.id.cardinal_number)
    TextView cardinalNumber;
    @BindView(R.id.sure_switchinfo_yesbtn)
    Button sureSwitchinfoYesbtn;
    onSureLiveOnRo monSureLiveOnRo;
    @BindView(R.id.title)
    TextView title;
    private Unbinder bind;


    public void setmInfotype(String mInfotype) {
        this.mInfotype = mInfotype;
    }

    public void setmBankNum(String mBankNum) {
        this.mBankNum = mBankNum;
    }

    public void setmUserName(String mUserName) {
        this.mUserName = mUserName;
    }

    public void setmSaveMoney(String mSaveMoney) {
        this.mSaveMoney = mSaveMoney;
    }

    public void setmUpNum(String mUpNum) {
        this.mUpNum = mUpNum;
    }

    public void setmCardInalNum(String mCardInalNum) {
        this.mCardInalNum = mCardInalNum;
    }

    public SureLiveOnRotationPp(@NonNull Context context, onSureLiveOnRo onSureLiveOnRo) {
        super(context);
        this.monSureLiveOnRo = onSureLiveOnRo;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.sure_live_onrotation_pp;
    }

    @OnClick(R.id.sure_switchinfo_yesbtn)
    public void onViewClicked() {
        monSureLiveOnRo.onCallSureLiveOnro();
    }

    String mInfotype;//交易类型
    String mBankNum;//卡号
    String mUserName;//用户名
    String mSaveMoney;//留存金额
    String mUpNum;//功能起点金额
    String mCardInalNum;//功能基数

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);
        sureSwitchinfoType.setText(mInfotype);
        sureSwitchinfoNumtext.setText(mBankNum);
        sureUsername.setText(mUserName);
        sureSaveMoney.setText(mSaveMoney);
        upNum.setText(mUpNum);
        cardinalNumber.setText(mCardInalNum);
        title.setText(mInfotype);

    }

    public interface onSureLiveOnRo {
        void onCallSureLiveOnro();
    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }
}
